package com.wwj.airline.Controller;

import com.wwj.airline.Dao.PriceMapper;
import com.wwj.airline.pojo.Price;
import com.wwj.airline.pojo.Seat;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/price")
public class PriceController {

    @Autowired(required = false)
    private PriceMapper priceMapper;

    @GetMapping("/findByFlightId/{flightId}")
    public List<Price> findByFlightId(@PathVariable("flightId") Long flightId){
        return priceMapper.findByFlightId(flightId);
    }
}
